<form class="layui-form seller-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <input type="text" name="user_name" lay-verify="title" placeholder="User Name" autocomplete="off"
                   class="layui-input" style="width: 200px;">
        </div>
        <div class="layui-inline">
            <input type="text" name="card_num" lay-verify="title" placeholder="Card Num" autocomplete="off"
                   class="layui-input" style="width: 200px;">
        </div>
        <div class="layui-inline">
            <input type="text" name="header" lay-verify="title" autocomplete="off" placeholder="header"
                   class="layui-input" style="width: 200px;">
        </div>
        <div class="layui-inline">
            <input type="text" name="request" lay-verify="title" autocomplete="off" placeholder="Request"
                   class="layui-input" style="width: 200px;">
        </div>
        <div class="layui-inline">
            <input type="text" name="response" lay-verify="title" autocomplete="off" placeholder="Response"
                   class="layui-input" style="width: 200px;">
        </div>
        <div class="layui-inline">
            <input type="text" name="datetime" id="datetime" style="width: 200px;"
                   placeholder="start_time _ end_time" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-inline">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-sm" lay-submit lay-filter="*"><i class="iconfont icon-chaxun"></i>Search</button>
            </div>
        </div>
    </div>
</form>
<div class="table-body">
    <table id="balanceTable" lay-filter="balanceTable"></table>
</div>
<pre class="layui-code">
// ComDate的Api
Method: POST
Endpoint: https://api.iconnectdata.com/FleetCreditWS/services/FleetCreditWS0200
WSDL: https://api.iconnectdata.com/FleetCreditWS/services/FleetCreditWS0200/wsdl/FleetCreditWS0200.wsdl
Header(SOAPAction): "http://fleetCredit02.comdata.com/FleetCreditWS0200/Soap_action
Request(XML):
<?php
   echo htmlentities('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:main="http://fleetCredit02.comdata.com/maintenance/">
   <soapenv:Header>
        <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken>
                <wsse:Username>Username</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Password</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
     </soapenv:Header>
   <soapenv:Body>
       列表中Request只存储Body内容...
   </soapenv:Body>
</soapenv:Envelope>'); ?>
</pre>
<script>
    layui.use(['form', 'laydate', 'table',], function () {
        var laydate = layui.laydate,
            form = layui.form,
            table = layui.table; //表格
        //时间插件
        laydate.render({
            elem: '#datetime',
            range: '_',
            format: 'yyyy-MM-dd'
        });
        table.render({
            elem: '#balanceTable',
            height: 'full-99',
            cellMinWidth: '80',
            // totalRow: true,
            method: 'post',
            url: "{:url('log/apiLog')}",
            id: 'balanceTable',
            cols: [[
                { type: 'numbers'},
                { field: 'username',  align: 'center', title: 'User Name',width: 170,
                    templet: function (d) {
                    const name = d.username;
                        if(name != null){
                            return name;
                        }else{
                            return '管理员';
                        }
                    }
                },
                { field: 'card_num',  align: 'left', title: 'CardNum',width: 160},
                { field: 'name',  align: 'left', title: 'Type',width: 150},
                { field: 'ip',  align: 'left', title: 'Ip',width: 100},
                { field: 'header',  align: 'left', title: 'SoapAction',width: 200},
                { field: 'response_json',  align: 'left', title: 'Response'},
                { align: 'center', title: 'Create Time',width:170,
                    templet: function (d) {
                        return layui.util.toDateString(d.ctime * 1000, "yyyy-MM-dd HH:mm:ss");
                    }
                },
                { field: 'option', title: 'Action', templet: function (d) {
                        return '<a class="layui-btn layui-btn-xs SearchDetail" data-id="' + d.id + '">info</a>';
                    }, align: 'center', width: 80
                },
            ]],
            page: true,
            limit: 20,
            limits: [20, 50, 100,5000],
        });
        form.on('submit(*)', function (data) {
            layui.table.reload('balanceTable', {
                where: data.field
                , page: {
                    curr: 1 //重新从第 1 页开始
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
        //余额编辑
        $(document).on('click', '.SearchDetail', function () {
            var id = $(this).attr('data-id');
            JsGet("{:url('log/showDetail')}?type=cd_log&id="+ id, function(e){
                if(e.status == 1){
                    layer.open({
                        type: 1,
                        title: 'Log Detail',
                        area: ['1000px', '600px'], //宽高
                        content: e.datas,
                        btn:['Close']
                    });
                }else{
                    layer.msg(e.msg);
                }
            });
        });
    });
</script>